/**
 * Copyright 2014-2016 eyaomall.com 
 * All rights reserved.
 * 
 * @project
 * @author jipengfei
 * @version 1.0
 * @date 2015-09-11
 */
package com.eyaomall.wxmall.service;

import java.math.BigDecimal;
import java.util.List;

import com.eyaomall.wxmall.model.po.Address;
import com.eyaomall.wxmall.model.po.Goods;
import com.eyaomall.wxmall.model.po.Order;
import com.eyaomall.wxmall.model.po.OrderGoods;
import com.eyaomall.wxmall.model.po.Shop;
import com.eyaomall.wxmall.model.pojo.ReqGoods;
import com.eyaomall.wxmall.model.vo.OrderVO;
import com.lycheeframework.core.cmp.kit.IHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;

/**
 * 订单service接口
 * @author jipengfei
 *
 */
public interface OrderService {

	/**
	 * 新增我的订单
	 * @param order
	 * @return
	 */
	public Integer create(Order order);
	
	/**
	 * 修改我的订单信息
	 * @param order
	 * @return
	 */
	public boolean update(Order order);

	/**
	 * 修改为已收货
	 * @param order
	 * @return
	 */
	public boolean setReceive(Order order);
	
	/**
	 * 根据订单ID查询订单详情
	 * @param orderId
	 * @return
	 */
	public OrderVO queryById(Integer orderId);
	
	/**
	 * 根据订单编号查询订单详情
	 * @param orderNo
	 * @return
	 */
	public OrderVO queryByOrderNo(String orderNo);
	
	/**
	 * 退货
	 * @param orderId
	 * @param refundAmount
	 * @param refundMemo
	 * @return
	 */
	public boolean refund(Integer orderId,BigDecimal refundAmount,String refundMemo);
	
	/**
	 * 新增订单
	 * @param goodsList
	 * @return
	 */
	public Integer create(final List<ReqGoods> goodsList,final Integer cityId,final Address address,final Integer cId);
	
	/**
	 * 分页查询订单产品信息
	 * @param goodsId
	 * @param httpObj
	 * @return
	 */
	public List<OrderGoods> listOrderGoods(Integer orderId);
	
	/**
	 * 分页查询我的订单信息
	 * @param order
	 * @param httpObject
	 * @return
	 */
	public Pages<List<Order>> page(Order order,IHTTPObject httpObject);
	
	/**
	 * 新增砍价活动订单
	 * @param discountId
	 * @return
	 */
	public Integer createDisCountOrder(Integer discountId,Goods goods,Address address,final Integer cId);
	
	/**
	 * 统计我的订单
	 * @param memberId
	 * @return
	 */
	public OrderVO calc(Integer memberId);
	
	/**
	 * 支付回调
	 * @param order
	 * @param goodsList
	 * @return
	 */
	public boolean changeStatus(Order order,List<OrderGoods> goodsList,Shop shop);
}

